/* stylelint-disable selector-max-specificity -- cell and column borders have
    lots of overlapping rules defined in different files that rely on different
    specificities to work, one day it would be good to tackle this and properly
    refactor border styles to be less specific */

/**
 * NOTE: these don't need RTL versions when pinning columns, "left" always means
 * visually on the left
 */

.ag-pinned-left-floating-top,
.ag-pinned-right-floating-top,
.ag-pinned-left-floating-bottom,
.ag-pinned-right-floating-bottom {
    overflow: hidden;
    position: relative;
    min-width: 0;
}

.ag-pinned-left-sticky-top,
.ag-pinned-right-sticky-top {
    position: relative;
    height: 100%;
    overflow: hidden;
}

.ag-sticky-top-full-width-container,
.ag-sticky-bottom-full-width-container {
    overflow: hidden;
    width: 100%;
    height: 100%;
}

.ag-pinned-left-header,
.ag-pinned-right-header {
    display: inline-block;
    position: relative;
    overflow: hidden;
    height: 100%;
}

.ag-body-horizontal-scroll:not(.ag-scrollbar-invisible) {
    .ag-horizontal-left-spacer:not(.ag-scroller-corner) {
        /* rtl:ignore */
        border-right: var(--ag-pinned-column-border);
    }

    .ag-horizontal-right-spacer:not(.ag-scroller-corner) {
        /* rtl:ignore */
        border-left: var(--ag-pinned-column-border);
    }
}

.ag-pinned-right-header {
    /* rtl:ignore */
    border-left: var(--ag-pinned-column-border);
}

.ag-pinned-left-header {
    /* rtl:ignore */
    border-right: var(--ag-pinned-column-border);
}

.ag-cell.ag-cell-first-right-pinned:not(
        .ag-cell-range-left,
        .ag-cell-range-single-cell,
        .ag-cell-focus:not(.ag-cell-range-selected):focus-within
    ) {
    /* rtl:ignore */
    border-left: var(--ag-pinned-column-border);
}

.ag-cell.ag-cell-last-left-pinned:not(
        .ag-cell-range-right,
        .ag-cell-range-single-cell,
        .ag-cell-focus:not(.ag-cell-range-selected):focus-within
    ) {
    /* rtl:ignore */
    border-right: var(--ag-pinned-column-border);
}

.ag-pinned-left-header .ag-header-cell-resize::after {
    /* rtl:ignore */
    left: calc(50% - var(--ag-header-column-resize-handle-width));
}

.ag-pinned-right-header .ag-header-cell-resize::after {
    /* rtl:ignore */
    left: 50%;
}

.ag-pinned-left-header .ag-header-cell-resize {
    /* pinned left headers always have their resize on the right, even in RTL mode */
    /* rtl:ignore */
    right: -3px;
}

.ag-pinned-right-header .ag-header-cell-resize {
    /* pinned right headers always have their resize on the left, even in RTL mode */
    /* rtl:ignore */
    left: -3px;
}
